package com.lsc.study.generic;

import com.sun.javafx.css.CalculatedValue;

public class NumberTest {
    public static void main(String[] args) {

        int a = 3, b = 4, c = 5;
        double x = 3, y = 4, z = 5;

        float e = 34F;
        double f = 34;
        long d = 9;

        int max = max(a, b, c);
        System.out.println(max);

        Float max1 = max(12F, 23F, 45F);
        System.out.println(max1);



//
//        calc(a, b, c);
//        calc(a, e, c);
//        calc(a, e, d);
//        calc(f, e, d);
    }
//    public static<T extends CalculatedValue> T calc(T a, T b, T c) {
//        return a + b + c;
//    }


    /* a>b?a:b */
    public static<T extends Comparable<T>> T max(T x, T y, T z) {
        return (x.compareTo(y) > 0 && x.compareTo(z) > 0) ? x : y.compareTo(z) > 0 ? y : z;
    }
}
